<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>04 do while</title>
</head>

<body>


    <script>
        //do 的代码块，要执行一次，哪怕不满足条件，也要执行一次
        var i = 10;
        do {
            console.log('i:', i);
            i++;
            console.log('i:', i);
        } while (i < 5);

        var t = 1;
        var sum = 0;
        do {
            sum += t;
            t++
        } while (t <= 100);
        console.log('sum:', sum);
    </script>
</body>

</html>